Conversation
- Add ConstrainedChoiceInfo type and constrainedChoice() index method - Export isChoiceDeclarationField and isChoiceInstanceField from utils - Deduplicate profile extensions by url:path in extension processing
- Add ifElseChain() and tsImport() with auto-wrapping to TypeScript writer - Add lineWidth option for long import line splitting - Add fieldTsType() helper to eliminate repeated type resolution pattern - Refactor method naming to suffix-based resolution with collision handling - Make indent()/deindent() protected in base Writer
- Add resolveExtensionInput(), isRawExtensionInput(), getExtensionValue() - Add isExtension() type guard with optional url parameter - Add ExtensionProfileLike type for profile instance detection - Enhance extractComplexExtension() with generics
- Extract extension generation to profile-extensions.ts (multi-form setters, getter modes, input resolution with ifElseChain) - Extract slice generation to profile-slices.ts - Extract validation generation to profile-validation.ts - Split from() into validating from() and non-validating apply() - Cache detectFieldOverrides, hoist polymorphicBaseNames, inline helpers
- Add profile tests: patient (extensions, multi-form setters, factory methods), blood pressure (component slices), body weight (demo) - Add US Core snapshot tests to typescript.test.ts - Add release announcement post and update example README - Update demo scripts to use static factory methods
- Slice setters accept union of flat input or raw FHIR type, using
matchesValue() to discriminate
- Slice getters use overloaded mode parameter ('flat' | 'raw') instead
of separate getXxx()/getXxxRaw() methods
- Rename extension getter mode 'extension' → 'raw' to match slice API
- Rename 'input' mode → 'flat' for both slice and extension getters
- Rename type suffixes: SliceInput → SliceFlat, Input → Flat,
InputRaw → Raw
- Add sliceGetterDefault option to TypeScriptOptions
3682d19 to
65a5e8a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ifElseChain,lineWidth, naming helpersfrom()/apply()factory methodsfrom(resource)— validates meta.profile + runsvalidate(), throws on errorsapply(resource)— stamps meta.profile without validation, for incremental constructionflat(typed object),profile(profile instance),raw(FHIR Extension)flat/raw/profile/extension)toProfile(), combine imports by module, remove dead helpers{ errors, warnings }fromvalidate()instead ofstring[]Before —
from()was a simple wrapper without validation:After —
from()validates,apply()stamps without validation:Before — extension setters accepted only one form:
After — multi-form setters accept flat input, profile instance, or raw Extension:
After — extension getters with mode overloads:
Before —
validate()returned a flat error array, no must-support awareness:After — structured result with errors and warnings:
Before — separate getter methods per mode:
After — overloaded single getter: